function ques(){
    var nameq = $('#nameq').val();
    if(nameq == '') {
        alert('You must fill in this place');
        $('#nameq').focus();
        return false;
    }
    var mailq = $('#mailq').val();
    if(checkEmail(mailq) == false){
        $('#mailq').focus();
        alert('Invalid email address');
        return false;
    }
    var content = $('#ctq').val();
    if(content == '') {
        alert('You must fill in this place');
        $('#ctq').focus();
        return false;
    }
    $.ajax({
        url: links+"home/ques/add",
        type: 'post',
        data:{content:content, nameq:nameq, mailq:mailq},
        success: function(data){
            var name_q = $('#nameq').val('');
            var email_q = $('#mailq').val('');
			$('#ctq').val('');
            alert("Thank you for your enquiry, we will contact you at the soonest!");
        }
    });
    return false;
}
function checkEmail(inputvalue){
    var pattern=/^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\.([a-zA-Z])+([a-zA-Z])+/;
    if(pattern.test(inputvalue)){
        return true;
    }else{
        return false;
    }
}